package com.example.csvphonetoregion;

import com.example.togetherutils.ReturnInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * 基于CSV文件获取手机号归属地
 */
@RestController
public class Controller {

    @Autowired
    private PhoneInfoByCsvUtil util;

    @GetMapping("/getPhoneInfoByCsv/{phone}")
    public ReturnInfo<?> getPhoneGeoInfoByCsv(@PathVariable("phone") String phone){
        return ReturnInfo.success(util.getPhoneInfo(phone));
    }
}

